home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol095 / pclist.bas < prev    next >
Encoding:
BASIC Source File  |  1986-12-15  |  16.0 KB  |  408 lines

  1. 1 ' SAVE "A:PC-LIST.BAS",A
  2. 2 ' SAVE "C:PC-LIST.BAS"
  3. 3 ' PLEASE DO NOT ALTER, BYPASS OR REMOVE LINES 3-49
  4. 4 '
  5. 5 ' PC-LIST  (ver. 1.0)       DOS 1.1     BASICA.COM
  6. 6 ' November 1983
  7. 7 ' by Clarence G. Byrd
  8. 8 ' C. G. BYRD ASSOCIATES
  9. 9 ' P.O. Box 213
  10. 10 ' Edmonds, WA 98020
  11. 11 ' Thanks to M. Harnois for usefull inputs to the program.
  12. 12 ' ***************************  NOTICE  ***************************
  13. 13 ' *  A limited license is granted to all users of this program,  *
  14. 14 ' *  to make copies of this program and distribute them to other *
  15. 15 ' *  users, on the following conditions:                         *
  16. 16 ' *     1. The notices contained in lines 1 through 49  of the   *
  17. 17 ' *        program are not to be altered, bypassed, or removed.  *
  18. 18 ' *     2. The program is not to be distributed to others in     *
  19. 19 ' *        modified form.                                        *
  20. 20 ' *     3. No fee is to be charged (or any other consideration   *
  21. 21 ' *        received) for copying or distributing the program     *
  22. 22 ' *        without an express written agreement with             *
  23. 23 ' *        The Headlands Press, Inc., Box 862, Tiburon, CA 94920 *
  24. 24 ' *                                                              *
  25. 25 ' *                 Copyright (c) 1983 C. G. BYRD ASSOCIATES     *
  26. 26 ' ****************************************************************
  27. 27 '
  28. 28 '
  29. 29 '
  30. 30 SCREEN 0,0,0,0:WIDTH 80:CLS:KEY OFF:LOCATE ,,0
  31. 31 PRINT TAB(60)"tm":PRINT TAB(16) STRING$(15,205)" F R E E W A R E "STRING$(15,205)
  32. 32 PRINT:PRINT TAB(28)"User-Supported Software":PRINT:PRINT TAB(7) CHR$(214)STRING$(62,196)CHR$(183)
  33. 33 FOR I=1 TO 11:READ A$:PRINT TAB(7) CHR$(186);A$;SPACE$(62-LEN(A$));CHR$(186):NEXT
  34. 34 PRINT TAB(7) CHR$(211)STRING$(62,196)CHR$(189):PRINT TAB(27)"Copyright (c) 1983 C. G. BYRD ASSOCIATES
  35. 35 DATA"    If you are using this program and finding it of value,
  36. 36 DATA"    your contribution ($15 suggested) will be appreciated.
  37. 37 DATA"
  38. 38 DATA"                          C. G. Byrd
  39. 39 DATA"                      Post Office Box 213
  40. 40 DATA"                       Edmonds, WA 98020
  41. 41 DATA"
  42. 42 DATA"       You are encouraged to copy and share this program
  43. 43 DATA"  with other users, on the conditions that the program is not
  44. 44 DATA"  distributed in modified form, that no fee or consideration
  45. 45 DATA"  is charged, and that this notice is not bypassed or removed.
  46. 46 '
  47. 47 '
  48. 48 '
  49. 49 '
  50. 100 LOCATE 22,5
  51. 110 PRINT "Press 'Anykey' to continue.   (check that your printer is ON Line)"
  52. 120 Z$=INKEY$:IF Z$="" THEN 120
  53. 130 ON ERROR GOTO 3440
  54. 140 DEFINT A-Z
  55. 150 FOR K=1 TO 10:KEY(K) OFF:NEXT
  56. 160 KEY OFF
  57. 170 WIDTH "SCRN:",80:WIDTH "LPT1:",255
  58. 180 ' Default Listing parameters
  59. 190 'TOP.MARGIN=3:BOT.MARGIN=86:PAGE.LEN=88:LEFT.MARGIN=4:RIGHT.MARGIN=94 'TALLY
  60. 200 TOP.MARGIN=3:BOT.MARGIN=64:PAGE.LEN=66:LEFT.MARGIN=4:RIGHT.MARGIN=78 'EPSON
  61. 210 T1=3:LPT.PORT=1
  62. 220 L2=LEFT.MARGIN + 6    'Indentation for long lines
  63. 230 UP$="###":PRESET.LO$="None set":PRESET.HI$="None set":FI$="None entered"
  64. 240 FALSE=0:TRUE=NOT FALSE
  65. 250 PHC.FLG=FALSE:HC.FLG=FALSE:HD.FLG=FALSE:BOT.FLG=FALSE:CR=FALSE:KEY.ON.FLG=TRUE
  66. 260 PAUSE.FLG=FALSE:KEY.ON.FLG=FALSE:LIST.FLG=FALSE:PRESET.FLG=FALSE:SCREEN.FLG=FALSE
  67. 270 TWO.LPT.FLG=FALSE      'change to TRUE for two line printers installed
  68. 280 IF TWO.LPT.FLG=TRUE THEN WIDTH "LPT2:",255
  69. 290 PAGE.NO=1:LINE.NO=0
  70. 300 SCREEN 0,0,3,3   'Write to page 3
  71. 310 CLS
  72. 320 LOCATE 10,30,0
  73. 330 PRINT "One moment, please."
  74. 340 PRINT TAB(30) "PC-LIST is working."
  75. 350 '
  76. 360 GOSUB 430     'Set up printer
  77. 370 GOSUB 2270    'Instructions written to page 1
  78. 380 GOSUB 1120    'Menu written to page 2
  79. 390 GOSUB 670     'Function Keys Destinations
  80. 400 GOSUB 980     'Enter File name S.R.
  81. 410 'Program returns to Listing Exec from File name S.R.
  82. 420 '
  83. 430 ' Line Printer setup S.R.
  84. 440 ESC$=CHR$(27)
  85. 450 '** MANNESMANN TALLY settings for 12 CPI/96 CPL, 8 LPI, USASCII Language
  86. 460 'LPRINT ESC$+"[0y"+ESC$+"[0y"+ESC$+"[5w"+ESC$+"[4z"+ESC$+"(B"+ESC$+"[1t";
  87. 470 '** EPSON settings for 10 CPI/80 CPL, 6 LPI, Data Mode
  88. 480  LPRINT ESC$+"F"+CHR$(18)+ESC$+"2"+ESC$+"C"+CHR$(1);
  89. 490 RETURN
  90. 500 '
  91. 510 ' FUNCTION key data
  92. 520 DATA 0,"      ",1,"Instru",1,"Params",1,"Filnam",1," HC-1 "
  93. 530 DATA 1," HC-2 ",1," CRT  ",1," Key  ",0,"      ",1,"SYSTEM"
  94. 540 DATA 1,"Escape",0,"      ",0,"      ",0,"      ",0,"      "
  95. 550 DATA 0,"      ",0,"      ",0,"      ",0,"      ",0,"      "
  96. 560 DATA 1,"Escape",0,"      ",0,"      ",0,"      ",1," HC-1 "
  97. 570 DATA 1," HC-2 ",1," CRT  ",1," Key  ",1," Pause",0,"      "
  98. 580 '
  99. 590 'FUNCTION key setup S.R
  100. 600 FOR L=1 TO 10
  101. 610  READ FLG,L$
  102. 620  KEY L,L$
  103. 630  IF FLG=1 THEN KEY (L) ON ELSE KEY (L) OFF
  104. 640 NEXT
  105. 650 RETURN
  106. 660 '
  107. 670 'FUNCTION key destinations
  108. 680 ON KEY(1) GOSUB 2540     'Escape
  109. 690 ON KEY(2) GOSUB 2210     'Instructions
  110. 700 ON KEY(3) GOSUB 1650     'Change Defaults
  111. 710 ON KEY(4) GOSUB 970      'Change Filename
  112. 720 ON KEY(5) GOSUB 1450     'Hard Copy w Single spacing
  113. 730 ON KEY(6) GOSUB 1440     'Hard Copu w Double spacing
  114. 740 ON KEY(7) GOSUB 2590     'CRT Display
  115. 750 ON KEY(8) GOSUB 830      'Toggle Function Keys ON/OFF
  116. 760 ON KEY(9) GOSUB 880      'Pause/Cont during Listing
  117. 770 ON KEY(10) GOSUB 930     'Return to DOS default drive
  118. 780 RETURN
  119. 790 '
  120. 800 'CRT Heading S.R.       Copyright  C.G.BYRD ASSOC.
  121. 810 PRINT TAB(T1)"*** FREEWARE      PC-LIST.BAS      C BYRD ***
  122. 820 RETURN
  123. 830 '
  124. 840 'KEY ON/OFF S.R.
  125. 850 IF KEY.ON.FLG THEN KEY OFF:KEY.ON.FLG=FALSE:GOTO 870
  126. 860 IF NOT KEY.ON.FLG THEN KEY ON:KEY.ON.FLG=TRUE
  127. 870 RETURN
  128. 880 '
  129. 890 'PAUSE/CONT S.R.
  130. 900 PAUSE.FLG=NOT PAUSE.FLG
  131. 910 IF PAUSE.FLG THEN KEY 9," Cont " ELSE KEY 9," Pause"
  132. 920 RETURN
  133. 930 '
  134. 940 'SYSTEM S.R.
  135. 950 CLOSE
  136. 960 SYSTEM
  137. 970 '
  138. 980 'Enter Filename S.R.
  139. 990 SCREEN 0,0,0,0
  140. 1000 CLS
  141. 1010 GOSUB 800
  142. 1020 PRINT
  143. 1030 KEY OFF
  144. 1040 LOCATE 3,T1
  145. 1050 PRINT "The Program (file) to be listed must be an ASCII (TEXT) type"
  146. 1060 LOCATE 5,T1
  147. 1070 PRINT "Enter Program Filename ("FI$")";:INPUT FI.TMP$
  148. 1080 IF FI.TMP$ <> "" THEN FI$=FI.TMP$
  149. 1090 GOSUB 1120
  150. 1100 RETURN 2640
  151. 1110 '
  152. 1120 'Menu screen S.R.    (page 2)
  153. 1130 SCREEN 0,0,2,3
  154. 1140 CLS
  155. 1150 GOSUB 800
  156. 1160 PRINT
  157. 1170 PRINT TAB(T1)"Filename is: "FI$
  158. 1180 PRINT
  159. 1190 PRINT TAB(T1)"Line Printer is assigned to Parallel Port #";LPT.PORT
  160. 1200 PRINT TAB(T1) "Filename, date, time, & page no. are on line 1."
  161. 1210 PRINT TAB(T1)"First text line is on line .........";:PRINT USING UP$;TOP.MARGIN
  162. 1220 PRINT TAB(T1)"Last text line is on line ..........";:PRINT USING UP$;BOT.MARGIN
  163. 1230 PRINT TAB(T1)"Page length in total lines is ......";:PRINT USING UP$;PAGE.LEN
  164. 1240 PRINT TAB(T1)"Leftmost character is in col no.....";:PRINT USING UP$;LEFT.MARGIN
  165. 1250 PRINT TAB(T1)"Right most character is in col no...";:PRINT USING UP$;RIGHT.MARGIN
  166. 1260 PRINT
  167. 1270 PRINT TAB(T1)"Preset STATEMENTS (LINES) for hard copy are: "+PRESET.LO$+" thru "+PRESET.HI$
  168. 1280 PRINT
  169. 1290 'PRINT TAB(T1) "Press 'F1' TO Escape"
  170. 1300 PRINT TAB(T1) "Press 'F2' for Instructions"
  171. 1310 PRINT TAB(T1) "Press 'F3' to change default parameters"
  172. 1320 PRINT TAB(T1) "Press 'F4' to change Filename"
  173. 1330 PRINT TAB(T1) "Press 'F5' for Hard Copy with single line spacing"
  174. 1340 PRINT TAB(T1) "Press 'F6' for Hard Copy with double line spacing"
  175. 1350 PRINT TAB(T1) "Press 'F7' for CRT display only (Preset STATEMENTS will Hard Copy)
  176. 1360 PRINT TAB(T1) "Press 'F8' to toggle KEY ON/OFF"
  177. 1370 'PRINT TAB(T1) "Press 'F9' to PAUSE/CONT during the listing process"
  178. 1380 PRINT TAB(T1) "Press 'F0' return to DOS default drive"
  179. 1390 IF SCREEN.FLG THEN SCREEN 0,0,0,2
  180. 1400 SCREEN.FLG=TRUE
  181. 1410 RETURN
  182. 1420 '
  183. 1430 'Hard copy flags S.R.
  184. 1440 HC.FLG=TRUE:HD.FLG=TRUE:GOTO 1460
  185. 1450 HC.FLG=TRUE:HD.FLG=FALSE
  186. 1460 IF LIST.FLG THEN RETURN
  187. 1470 SCREEN 0,0,0,0
  188. 1480 CLS
  189. 1490 GOSUB 800
  190. 1500 KEY OFF
  191. 1510 PRINT
  192. 1520 PRINT TAB(T1) "Check your Line Printer for:"
  193. 1530 PRINT TAB(T1) "1  Power On"
  194. 1540 PRINT TAB(T1) "2  On Line"
  195. 1550 PRINT TAB(T1) "3  Paper at Top of Form"
  196. 1560 'PRINT TAB(T1) "4   add other checks of interest here  "
  197. 1570 'PRINT TAB(T1) "5   add other checks of interest here  "
  198. 1580 'PRINT TAB(T1) "6   add other checks of interest here  "
  199. 1590 PRINT
  200. 1600 PRINT TAB(T1) "Is the PRINTER ready?  Y/N "
  201. 1610 Z$=INKEY$
  202. 1620 IF Z$="Y" OR Z$="y" THEN GOSUB 430:RETURN 2710
  203. 1630 IF Z$="N" OR Z$="n" THEN RETURN 2640 ELSE 1610
  204. 1640 '
  205. 1650 'Change parameters S.R.
  206. 1660 SCREEN 0,0,0,0
  207. 1670 CLS
  208. 1680 KEY OFF
  209. 1690 FOR N=1 TO 10:KEY(N) OFF:KEY N,"":NEXT
  210. 1700 GOSUB 800
  211. 1710 LOCATE 4,T1,1
  212. 1720 PRINT TAB(T1) "Press '<CR>' to keep parenthetical values. "
  213. 1730 PRINT
  214. 1740 IF TWO.LPT.FLG=FALSE THEN LPT.PORT=1:GOTO 1780
  215. 1750 PRINT TAB(T1) "Enter Parallel Port # for Line Printer #1 ("LPT.PORT")";:INPUT LPT.TMP$
  216. 1760 IF LPT.TMP$ <>"" THEN LPT.PORT=VAL(LPT.TMP$)
  217. 1770 IF LPT.PORT <1 OR LPT.PORT >2 THEN LPT.PORT=1
  218. 1780 GOSUB 430    'Set up printer
  219. 1790 PRINT
  220. 1800 PRINT TAB(T1) "Enter 'line no.' for first text line ("TOP.MARGIN")";:INPUT TMTMP
  221. 1810 IF TMTMP<>0 THEN TOP.MARGIN=TMTMP
  222. 1820 IF TOP.MARGIN<2 THEN TOP.MARGIN=2
  223. 1830 PRINT TAB(T1) "Enter 'line no.' for last text line ("BOT.MARGIN")";:INPUT BMTMP
  224. 1840 IF BMTMP<>0 THEN BOT.MARGIN=BMTMP
  225. 1850 PRINT TAB(T1) "Enter the total lines per page      ("PAGE.LEN")";:INPUT PLTMP
  226. 1860 IF PLTMP<>0 THEN PAGE.LEN=PLTMP
  227. 1870 IF PAGE.LEN <=BOT.MARGIN THEN PAGE.LEN=BOT.MARGIN + 1
  228. 1880 PRINT TAB(T1) "Enter col no. for left most column  ("LEFT.MARGIN")";:INPUT LMTMP
  229. 1890 IF LMTMP<>0 THEN LEFT.MARGIN=LMTMP
  230. 1900 PRINT TAB(T1) "Enter col no. for right most column ("RIGHT.MARGIN")";:INPUT RMTMP
  231. 1910 IF RMTMP<>0 THEN RIGHT.MARGIN=RMTMP
  232. 1920 IF RIGHT.MARGIN-LEFT.MARGIN <45 THEN RIGHT.MARGIN=LEFT.MARGIN + 45
  233. 1930 PRINT TAB(T1) "Enter first STATEMENT for pre-set hard copy ("+PRESET.LO$+")";:INPUT PTMP$
  234. 1940 IF PTMP$ <> "" THEN PRESET.LO$=PTMP$
  235. 1950 IF ASC(LEFT$(PRESET.LO$,1)) > 57 OR ASC(LEFT$(PRESET.LO$,1)) < 48 THEN PRESET.FLG=FALSE:GOTO 2000
  236. 1960 PRINT TAB(T1) "Enter last  STATEMENT for pre-set hard copy ("+PRESET.HI$+")";:INPUT PTMP$
  237. 1970 IF PTMP$ <> "" THEN PRESET.HI$=PTMP$
  238. 1980 UP1$=PRESET.HI$:UP2$="":GOSUB 3210
  239. 1990 IF VAL(PRESET.HI$) < VAL(PRESET.LO$) THEN PRESET.FLG=FALSE
  240. 2000 IF PRESET.FLG=TRUE THEN PRESET.HI$=UP2$ ELSE PRESET.HI$="None set":PRESET.LO$="None set"
  241. 2010 GOSUB 1120
  242. 2020 RETURN 2640
  243. 2030 '
  244. 2040 ' *    Copyright (c) 1983 C. G. BYRD ASSOCIATES     *
  245. 2050 '
  246. 2060 'LPRINT  S.R.
  247. 2070 IF LINE.NO=0 THEN PRINT #LPT.PORT,TAB(LEFT.MARGIN) FI$+"  "+DATE$+" "+TIME$;TAB(RIGHT.MARGIN-8) "Page";:PRINT #LPT.PORT,USING UP$;PAGE.NO:GOSUB 2140
  248. 2080 IF TAB.COL=LEFT.MARGIN THEN PRINT #LPT.PORT,TAB(TAB.COL) PRINT.STR$;:RETURN
  249. 2090 PRINT #LPT.PORT,TAB(TAB.COL) PRINT.STR$
  250. 2100 GOSUB 2140
  251. 2110 IF HD.FLG THEN PRINT #LPT.PORT,CHR$(0):GOSUB 2140
  252. 2120 IF EOF(3) THEN FOR N=1 TO PAGE.LEN-LINE.NO:PRINT #LPT.PORT,"":NEXT
  253. 2130 RETURN
  254. 2140 '
  255. 2150 'LINE.NO/PAGE.NO S.R.
  256. 2160 LINE.NO=LINE.NO + 1
  257. 2170 IF LINE.NO=1 THEN FOR N=1 TO TOP.MARGIN-2:PRINT #LPT.PORT,"":LINE.NO=LINE.NO+1:NEXT
  258. 2180 IF LINE.NO=BOT.MARGIN THEN FOR N=BOT.MARGIN+1 TO PAGE.LEN:PRINT #LPT.PORT,"":LINE.NO=LINE.NO+1:NEXT:LINE.NO=0:PAGE.NO=PAGE.NO+1
  259. 2190 RETURN
  260. 2200 '
  261. 2210 'Instructions Key S.R.
  262. 2220 SCREEN 0,0,1,1
  263. 2230 RESTORE 540:GOSUB 590
  264. 2240 KEY ON:KEY.ON.FLG=TRUE
  265. 2250 GOTO 2250
  266. 2260 '
  267. 2270 'Instructions S.R.
  268. 2280 SCREEN 0,0,1,3
  269. 2290 CLS
  270. 2300 GOSUB 800      'Heading
  271. 2310 PRINT
  272. 2320 RESTORE 540
  273. 2330 GOSUB 590      'Function Key Setup for Escape
  274. 2340 LOCATE 3,1,0
  275. 2350 PRINT TAB(T1) "*****************************************************************"
  276. 2360 PRINT TAB(T1) "*   HC-1 gives hard copy with single line spacing. (Final copy) *"
  277. 2370 PRINT TAB(T1) "*   HC-2 gives double line spacing.  (Correcting listings)      *"
  278. 2380 PRINT TAB(T1) "*   Preset STATEMENTS will be hard copied even in CRT mode.     *"
  279. 2390 PRINT TAB(T1) "*   PAUSE / CONT are used to pause listings in process.         *"
  280. 2400 PRINT TAB(T1) "*                                                               *"
  281. 2410 PRINT TAB(T1) "*   These Instructions are in statements 2350 thru 2490.        *"
  282. 2420 PRINT TAB(T1) "*   Printer prompts/instructions may be added by the user in    *"
  283. 2430 PRINT TAB(T1) "*       program statements 1560 thru 1580.                      *"
  284. 2440 PRINT TAB(T1) "*   For two line printers, change FALSE to TRUE in statement 270*"
  285. 2450 PRINT TAB(T1) "*   Printer drivers are in statements 430 thru 490.  You may    *"
  286. 2460 PRINT TAB(T1) "*       want to change drivers or omit then altogether.         *"
  287. 2470 PRINT TAB(T1) "*                                                               *"
  288. 2480 PRINT TAB(T1) "*   Listing default paramenters are in statements 180 thru 200. *"
  289. 2490 PRINT TAB(T1) "*****************************************************************"
  290. 2500 LOCATE 20,T1
  291. 2510 PRINT "Press F1 to return to Menu";
  292. 2520 RETURN
  293. 2530 '
  294. 2540 'Escape S.R.
  295. 2550 ESCAPE.FLG=TRUE
  296. 2560 PAUSE.FLG=FALSE
  297. 2570 CLOSE
  298. 2580 RETURN 2640
  299. 2590 '
  300. 2600 'CRT only S.R
  301. 2610 HC.FLG=FALSE:HD.FLG=FALSE
  302. 2620 IF LIST.FLG THEN RETURN
  303. 2630 RETURN 2710
  304. 2640 '
  305. 2650 'Listing Exec S.R.
  306. 2660 SCREEN 0,0,2,2
  307. 2670 RESTORE 520:GOSUB 590
  308. 2680 KEY ON:KEY.ON.FLG=TRUE
  309. 2690 LIST.FLG=FALSE:PAGE.NO=1:LINE.NO=0
  310. 2700 GOTO 2700
  311. 2710 SCREEN 0,0,0,0
  312. 2720 PAGE.NO=1
  313. 2730 '
  314. 2740 CLS
  315. 2750 IF LPT.PORT=2 THEN OPEN "O",#2,"LPT2:" ELSE OPEN "O",#1,"LPT1:"
  316. 2760 OPEN "I",#3,FI$
  317. 2770 RESTORE 560   'Keys
  318. 2780 GOSUB 590
  319. 2790 KEY ON
  320. 2800 PRINT.LEN=RIGHT.MARGIN-LEFT.MARGIN-5
  321. 2810 LIST.FLG=TRUE
  322. 2820 ESCAPE.FLG=FALSE
  323. 2830 '
  324. 2840 LINE INPUT #3,FILE.LINE$   'statement re-entry point
  325. 2850 IF PAUSE.FLG THEN 2850
  326. 2860 IF ESCAPE.FLG THEN ESCAPE.FLG=FALSE:GOTO 2970
  327. 2870 GOSUB 3010                 'get statement no.
  328. 2880 TAB.COL=LEFT.MARGIN
  329. 2890 PRINT.STR$=STMT.NO$
  330. 2900 PRINT TAB(TAB.COL) PRINT.STR$;
  331. 2910 GOSUB 3150     'preset hard copy flags
  332. 2920 IF HC.FLG OR PHC.FLG THEN GOSUB 2060
  333. 2930 ALL.STMT$=FILE.STMT$:ALL.STMT.LEN=FILE.STMT.LEN
  334. 2940 GOSUB 3310
  335. 2950 IF EOF(3) THEN 2970
  336. 2960 GOTO 2840
  337. 2970 CLOSE
  338. 2980 PRINT
  339. 2990 PRINT TAB(T1) "Press 'F1' to return to Menu";
  340. 3000 GOTO 3000
  341. 3010 '
  342. 3020 ' Statement line number S.R
  343. 3030 L$=""
  344. 3040 FOR N=1 TO 6
  345. 3050  M=N
  346. 3060  N$=MID$(FILE.LINE$,N,1)
  347. 3070  L$=L$+N$
  348. 3080  IF N$=" " THEN N=6
  349. 3090 NEXT
  350. 3100 STMT.NO$="      "
  351. 3110 MID$(STMT.NO$,7-M,M)=L$
  352. 3120 FILE.STMT.LEN=LEN(FILE.LINE$)-M
  353. 3130 FILE.STMT$=RIGHT$(FILE.LINE$,FILE.STMT.LEN)
  354. 3140 RETURN
  355. 3150 '
  356. 3160 'Preset hard copy S.R.
  357. 3170 STMT.NO!=VAL(STMT.NO$)
  358. 3180 IF STMT.NO! >= VAL(PRESET.LO$) THEN PHC.FLG=TRUE
  359. 3190 IF STMT.NO! >  VAL(PRESET.HI$) THEN PHC.FLG=FALSE
  360. 3200 RETURN
  361. 3210 '
  362. 3220 'Preset values S.R.
  363. 3230 PRESET.FLG=TRUE
  364. 3240 FOR J=1 TO LEN(UP1$)
  365. 3250 IF J > 5 THEN 3300
  366. 3260  CH$=MID$(UP1$,J,1):N=ASC(CH$):UP2$=UP2$+CH$
  367. 3270 IF N < 48 OR N >57 THEN PRESET.FLG=FALSE:GOTO 3300
  368. 3280 NEXT
  369. 3290 IF VAL(UP2$) > 65529! THEN PRESET.FLG=FALSE
  370. 3300 RETURN
  371. 3310 '
  372. 3320 'Multiple statements per line S.R.
  373. 3330 NO.STMT.SEG!=ALL.STMT.LEN/PRINT.LEN
  374. 3340 NO.STMT.SEG=1 + FIX(NO.STMT.SEG!)
  375. 3350 FOR J=0 TO NO.STMT.SEG-1
  376. 3360  STMT.SEG$=MID$(ALL.STMT$,(J * PRINT.LEN)+1,PRINT.LEN)
  377. 3370  TAB.COL=LEFT.MARGIN + 6
  378. 3380  PRINT.STR$=STMT.SEG$
  379. 3390  PRINT TAB(TAB.COL) PRINT.STR$
  380. 3400 IF HC.FLG OR PHC.FLG THEN GOSUB 2060
  381. 3410 NEXT
  382. 3420 RETURN
  383. 3430 END
  384. 3440 '
  385. 3450 'ERROR traps
  386. 3460 BEEP
  387. 3470 IF ERR=52 THEN PRINT"*** Invalid Filename - Please re-enter ***":GOTO 3600
  388. 3480 IF ERR=53 THEN PRINT"*** File not found - Please re-enter ***":GOTO 3600
  389. 3490 IF ERR=64 THEN PRINT"*** Bad file name - Please re-enter ***":GOTO 3600
  390. 3500 IF ERR=24 THEN PRINT"*** Device timeout - Please check your printer for ON LINE ***":GOTO 3560
  391. 3510 IF ERR=68 THEN PRINT"*** Device unavailable - Please check printer ports for one or two printers.":GOTO 3560
  392. 3520 IF ERR=71 THEN PRINT"** Device not ready - Please check for drive door open or diskette not in drive *":GOTO 3560
  393. 3530 PRINT
  394. 3540 PRINT "ERROR:  "ERR
  395. 3550 PRINT "In Line:"ERL
  396. 3560 PRINT
  397. 3570 PRINT "You are now in BASIC.  Correct the problem then type RUN <CR>"
  398. 3580 RESUME 3590
  399. 3590 END
  400. 3600 PRINT
  401. 3610 KEY OFF
  402. 3620 CLOSE
  403. 3630 PRINT "Press 'Anykey' to return to Menu."
  404. 3640 Z$=INKEY$:IF Z$="" THEN 3640
  405. 3650 RESUME 2640
  406. 3610 KEY OFF
  407. 3620 CLOSE
  408. 3630 PRINT "Pr